import CryptoJS from "@/node_modules/crypto-js/crypto-js.js"
let KEY = 'H5I6m6WDOkQZD0Zk'
let IV = '';
let tools = {
	// 加密函数
	encryptPassword(password, key) {
		// 将密码和密钥转换为 WordArray 对象
		const passwordBytes = CryptoJS.enc.Utf8.parse(password);
		const keyBytes = CryptoJS.enc.Utf8.parse(key);

		// 使用 AES 加密
		const encrypted = CryptoJS.AES.encrypt(passwordBytes, keyBytes, {
			mode: CryptoJS.mode.ECB,
			padding: CryptoJS.pad.Pkcs7
		});

		// 返回加密后的密码
		return encrypted.toString();
	}



};

export default tools;